#
username = "syan"
password = "123"
def auth(funt):
    def index(*args,**kwargs):
        while True:
            user = input("username:")
            passwd = input("password:")
            if user == username and passwd == password:
                print("------")
                return funt(*args,**kwargs) #*******funt,not login
            else:
                print("用户名密码错误，重新输入")
    return index

@auth #index=auth(index) #index=login
def index(msg):
    print("in the index:",msg)
    # return 1

index("aaa") #login()


#
# def f1():
#     def f2():
#         def f3():
#             print("x")
#         return f3
#     return f2
# f2=f1()
# f3=f2()
# f3()
